import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/couser_center/get_children_entity.dart';
import 'package:get/get_rx/src/rx_types/rx_types.dart';


GetChildrenEntity $GetChildrenEntityFromJson(Map<String, dynamic> json) {
  final GetChildrenEntity getChildrenEntity = GetChildrenEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getChildrenEntity.id = id;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    getChildrenEntity.companyCode = companyCode;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    getChildrenEntity.textbookId = textbookId;
  }
  final String? commentContent = jsonConvert.convert<String>(json['commentContent']);
  if (commentContent != null) {
    getChildrenEntity.commentContent = commentContent;
  }
  final String? commentUserId = jsonConvert.convert<String>(json['commentUserId']);
  if (commentUserId != null) {
    getChildrenEntity.commentUserId = commentUserId;
  }
  final String? commentUserName = jsonConvert.convert<String>(json['commentUserName']);
  if (commentUserName != null) {
    getChildrenEntity.commentUserName = commentUserName;
  }
  final dynamic commentPid = json['commentPid'];
  if (commentPid != null) {
    getChildrenEntity.commentPid = commentPid;
  }
  final int? commentType = jsonConvert.convert<int>(json['commentType']);
  if (commentType != null) {
    getChildrenEntity.commentType = commentType;
  }
  final dynamic commentScore = json['commentScore'];
  if (commentScore != null) {
    getChildrenEntity.commentScore = commentScore;
  }
  final int? commentLike = jsonConvert.convert<int>(json['commentLike']);
  if (commentLike != null) {
    getChildrenEntity.commentLike = commentLike;
  }
  final int? commentSee = jsonConvert.convert<int>(json['commentSee']);
  if (commentSee != null) {
    getChildrenEntity.commentSee = commentSee;
  }
  final String? commentPath = jsonConvert.convert<String>(json['commentPath']);
  if (commentPath != null) {
    getChildrenEntity.commentPath = commentPath;
  }
  final int? isLike = jsonConvert.convert<int>(json['isLike']);
  if (isLike != null) {
    getChildrenEntity.isLike = isLike;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getChildrenEntity.createBy = createBy;
  }
  final dynamic createById = json['createById'];
  if (createById != null) {
    getChildrenEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getChildrenEntity.createDate = createDate;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getChildrenEntity.updateBy = updateBy;
  }
  final dynamic updateById = json['updateById'];
  if (updateById != null) {
    getChildrenEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getChildrenEntity.updateDate = updateDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getChildrenEntity.deleted = deleted;
  }
  final List<GetChildrenChildren>? children = (json['children'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<GetChildrenChildren>(e) as GetChildrenChildren).toList();
  if (children != null) {
    getChildrenEntity.children = children;
  }
  final dynamic commentCount = json['commentCount'];
  if (commentCount != null) {
    getChildrenEntity.commentCount = commentCount;
  }
  return getChildrenEntity;
}

Map<String, dynamic> $GetChildrenEntityToJson(GetChildrenEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyCode'] = entity.companyCode;
  data['textbookId'] = entity.textbookId;
  data['commentContent'] = entity.commentContent;
  data['commentUserId'] = entity.commentUserId;
  data['commentUserName'] = entity.commentUserName;
  data['commentPid'] = entity.commentPid;
  data['commentType'] = entity.commentType;
  data['commentScore'] = entity.commentScore;
  data['commentLike'] = entity.commentLike;
  data['commentSee'] = entity.commentSee;
  data['commentPath'] = entity.commentPath;
  data['isLike'] = entity.isLike;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['deleted'] = entity.deleted;
  data['children'] = entity.children?.map((v) => v.toJson()).toList();
  data['commentCount'] = entity.commentCount;
  return data;
}

extension GetChildrenEntityExtension on GetChildrenEntity {
  GetChildrenEntity copyWith({
    String? id,
    String? companyCode,
    String? textbookId,
    String? commentContent,
    String? commentUserId,
    String? commentUserName,
    dynamic commentPid,
    int? commentType,
    dynamic commentScore,
    int? commentLike,
    int? commentSee,
    String? commentPath,
    int? isLike,
    String? createBy,
    dynamic createById,
    String? createDate,
    String? updateBy,
    dynamic updateById,
    String? updateDate,
    String? deleted,
    List<GetChildrenChildren>? children,
    dynamic commentCount,
  }) {
    return GetChildrenEntity()
      ..id = id ?? this.id
      ..companyCode = companyCode ?? this.companyCode
      ..textbookId = textbookId ?? this.textbookId
      ..commentContent = commentContent ?? this.commentContent
      ..commentUserId = commentUserId ?? this.commentUserId
      ..commentUserName = commentUserName ?? this.commentUserName
      ..commentPid = commentPid ?? this.commentPid
      ..commentType = commentType ?? this.commentType
      ..commentScore = commentScore ?? this.commentScore
      ..commentLike = commentLike ?? this.commentLike
      ..commentSee = commentSee ?? this.commentSee
      ..commentPath = commentPath ?? this.commentPath
      ..isLike = isLike ?? this.isLike
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..deleted = deleted ?? this.deleted
      ..children = children ?? this.children
      ..commentCount = commentCount ?? this.commentCount;
  }
}

GetChildrenChildren $GetChildrenChildrenFromJson(Map<String, dynamic> json) {
  final GetChildrenChildren getChildrenChildren = GetChildrenChildren();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getChildrenChildren.id = id;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    getChildrenChildren.companyCode = companyCode;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    getChildrenChildren.textbookId = textbookId;
  }
  final String? commentContent = jsonConvert.convert<String>(json['commentContent']);
  if (commentContent != null) {
    getChildrenChildren.commentContent = commentContent;
  }
  final String? commentUserId = jsonConvert.convert<String>(json['commentUserId']);
  if (commentUserId != null) {
    getChildrenChildren.commentUserId = commentUserId;
  }
  final String? commentUserName = jsonConvert.convert<String>(json['commentUserName']);
  if (commentUserName != null) {
    getChildrenChildren.commentUserName = commentUserName;
  }
  final String? commentPid = jsonConvert.convert<String>(json['commentPid']);
  if (commentPid != null) {
    getChildrenChildren.commentPid = commentPid;
  }
  final int? commentType = jsonConvert.convert<int>(json['commentType']);
  if (commentType != null) {
    getChildrenChildren.commentType = commentType;
  }
  final dynamic commentScore = json['commentScore'];
  if (commentScore != null) {
    getChildrenChildren.commentScore = commentScore;
  }
  final int? commentLike = jsonConvert.convert<int>(json['commentLike']);
  if (commentLike != null) {
    getChildrenChildren.commentLike = commentLike;
  }
  final int? commentSee = jsonConvert.convert<int>(json['commentSee']);
  if (commentSee != null) {
    getChildrenChildren.commentSee = commentSee;
  }
  final String? commentPath = jsonConvert.convert<String>(json['commentPath']);
  if (commentPath != null) {
    getChildrenChildren.commentPath = commentPath;
  }
  final int? isLike = jsonConvert.convert<int>(json['isLike']);
  if (isLike != null) {
    getChildrenChildren.isLike = isLike;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getChildrenChildren.createBy = createBy;
  }
  final dynamic createById = json['createById'];
  if (createById != null) {
    getChildrenChildren.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getChildrenChildren.createDate = createDate;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getChildrenChildren.updateBy = updateBy;
  }
  final dynamic updateById = json['updateById'];
  if (updateById != null) {
    getChildrenChildren.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getChildrenChildren.updateDate = updateDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getChildrenChildren.deleted = deleted;
  }
  final List<GetChildrenChildrenChildren>? children = (json['children'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<GetChildrenChildrenChildren>(e) as GetChildrenChildrenChildren).toList();
  if (children != null) {
    getChildrenChildren.children = children;
  }
  final dynamic commentCount = json['commentCount'];
  if (commentCount != null) {
    getChildrenChildren.commentCount = commentCount;
  }
  return getChildrenChildren;
}

Map<String, dynamic> $GetChildrenChildrenToJson(GetChildrenChildren entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyCode'] = entity.companyCode;
  data['textbookId'] = entity.textbookId;
  data['commentContent'] = entity.commentContent;
  data['commentUserId'] = entity.commentUserId;
  data['commentUserName'] = entity.commentUserName;
  data['commentPid'] = entity.commentPid;
  data['commentType'] = entity.commentType;
  data['commentScore'] = entity.commentScore;
  data['commentLike'] = entity.commentLike;
  data['commentSee'] = entity.commentSee;
  data['commentPath'] = entity.commentPath;
  data['isLike'] = entity.isLike;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['deleted'] = entity.deleted;
  data['children'] = entity.children?.map((v) => v.toJson()).toList();
  data['commentCount'] = entity.commentCount;
  return data;
}

extension GetChildrenChildrenExtension on GetChildrenChildren {
  GetChildrenChildren copyWith({
    String? id,
    String? companyCode,
    String? textbookId,
    String? commentContent,
    String? commentUserId,
    String? commentUserName,
    String? commentPid,
    int? commentType,
    dynamic commentScore,
    int? commentLike,
    int? commentSee,
    String? commentPath,
    int? isLike,
    String? createBy,
    dynamic createById,
    String? createDate,
    String? updateBy,
    dynamic updateById,
    String? updateDate,
    String? deleted,
    List<GetChildrenChildrenChildren>? children,
    dynamic commentCount,
    RxBool? isShow,
    RxInt? commentLikeX,
    bool? commentLikeXOnclick,
  }) {
    return GetChildrenChildren()
      ..id = id ?? this.id
      ..companyCode = companyCode ?? this.companyCode
      ..textbookId = textbookId ?? this.textbookId
      ..commentContent = commentContent ?? this.commentContent
      ..commentUserId = commentUserId ?? this.commentUserId
      ..commentUserName = commentUserName ?? this.commentUserName
      ..commentPid = commentPid ?? this.commentPid
      ..commentType = commentType ?? this.commentType
      ..commentScore = commentScore ?? this.commentScore
      ..commentLike = commentLike ?? this.commentLike
      ..commentSee = commentSee ?? this.commentSee
      ..commentPath = commentPath ?? this.commentPath
      ..isLike = isLike ?? this.isLike
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..deleted = deleted ?? this.deleted
      ..children = children ?? this.children
      ..commentCount = commentCount ?? this.commentCount
      ..isShow = isShow ?? this.isShow
      ..commentLikeX = commentLikeX ?? this.commentLikeX
      ..commentLikeXOnclick = commentLikeXOnclick ?? this.commentLikeXOnclick;
  }
}

GetChildrenChildrenChildren $GetChildrenChildrenChildrenFromJson(Map<String, dynamic> json) {
  final GetChildrenChildrenChildren getChildrenChildrenChildren = GetChildrenChildrenChildren();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getChildrenChildrenChildren.id = id;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    getChildrenChildrenChildren.companyCode = companyCode;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    getChildrenChildrenChildren.textbookId = textbookId;
  }
  final String? commentContent = jsonConvert.convert<String>(json['commentContent']);
  if (commentContent != null) {
    getChildrenChildrenChildren.commentContent = commentContent;
  }
  final String? commentUserId = jsonConvert.convert<String>(json['commentUserId']);
  if (commentUserId != null) {
    getChildrenChildrenChildren.commentUserId = commentUserId;
  }
  final String? commentUserName = jsonConvert.convert<String>(json['commentUserName']);
  if (commentUserName != null) {
    getChildrenChildrenChildren.commentUserName = commentUserName;
  }
  final String? commentPid = jsonConvert.convert<String>(json['commentPid']);
  if (commentPid != null) {
    getChildrenChildrenChildren.commentPid = commentPid;
  }
  final int? commentType = jsonConvert.convert<int>(json['commentType']);
  if (commentType != null) {
    getChildrenChildrenChildren.commentType = commentType;
  }
  final dynamic commentScore = json['commentScore'];
  if (commentScore != null) {
    getChildrenChildrenChildren.commentScore = commentScore;
  }
  final int? commentLike = jsonConvert.convert<int>(json['commentLike']);
  if (commentLike != null) {
    getChildrenChildrenChildren.commentLike = commentLike;
  }
  final int? commentSee = jsonConvert.convert<int>(json['commentSee']);
  if (commentSee != null) {
    getChildrenChildrenChildren.commentSee = commentSee;
  }
  final String? commentPath = jsonConvert.convert<String>(json['commentPath']);
  if (commentPath != null) {
    getChildrenChildrenChildren.commentPath = commentPath;
  }
  final int? isLike = jsonConvert.convert<int>(json['isLike']);
  if (isLike != null) {
    getChildrenChildrenChildren.isLike = isLike;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getChildrenChildrenChildren.createBy = createBy;
  }
  final dynamic createById = json['createById'];
  if (createById != null) {
    getChildrenChildrenChildren.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getChildrenChildrenChildren.createDate = createDate;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getChildrenChildrenChildren.updateBy = updateBy;
  }
  final dynamic updateById = json['updateById'];
  if (updateById != null) {
    getChildrenChildrenChildren.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getChildrenChildrenChildren.updateDate = updateDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getChildrenChildrenChildren.deleted = deleted;
  }
  final List<dynamic>? children = (json['children'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (children != null) {
    getChildrenChildrenChildren.children = children;
  }
  final dynamic commentCount = json['commentCount'];
  if (commentCount != null) {
    getChildrenChildrenChildren.commentCount = commentCount;
  }
  return getChildrenChildrenChildren;
}

Map<String, dynamic> $GetChildrenChildrenChildrenToJson(GetChildrenChildrenChildren entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyCode'] = entity.companyCode;
  data['textbookId'] = entity.textbookId;
  data['commentContent'] = entity.commentContent;
  data['commentUserId'] = entity.commentUserId;
  data['commentUserName'] = entity.commentUserName;
  data['commentPid'] = entity.commentPid;
  data['commentType'] = entity.commentType;
  data['commentScore'] = entity.commentScore;
  data['commentLike'] = entity.commentLike;
  data['commentSee'] = entity.commentSee;
  data['commentPath'] = entity.commentPath;
  data['isLike'] = entity.isLike;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['deleted'] = entity.deleted;
  data['children'] = entity.children;
  data['commentCount'] = entity.commentCount;
  return data;
}

extension GetChildrenChildrenChildrenExtension on GetChildrenChildrenChildren {
  GetChildrenChildrenChildren copyWith({
    String? id,
    String? companyCode,
    String? textbookId,
    String? commentContent,
    String? commentUserId,
    String? commentUserName,
    String? commentPid,
    int? commentType,
    dynamic commentScore,
    int? commentLike,
    int? commentSee,
    String? commentPath,
    int? isLike,
    String? createBy,
    dynamic createById,
    String? createDate,
    String? updateBy,
    dynamic updateById,
    String? updateDate,
    String? deleted,
    List<dynamic>? children,
    dynamic commentCount,
    RxInt? commentLikeX,
    bool? commentLikeXOnclick,
  }) {
    return GetChildrenChildrenChildren()
      ..id = id ?? this.id
      ..companyCode = companyCode ?? this.companyCode
      ..textbookId = textbookId ?? this.textbookId
      ..commentContent = commentContent ?? this.commentContent
      ..commentUserId = commentUserId ?? this.commentUserId
      ..commentUserName = commentUserName ?? this.commentUserName
      ..commentPid = commentPid ?? this.commentPid
      ..commentType = commentType ?? this.commentType
      ..commentScore = commentScore ?? this.commentScore
      ..commentLike = commentLike ?? this.commentLike
      ..commentSee = commentSee ?? this.commentSee
      ..commentPath = commentPath ?? this.commentPath
      ..isLike = isLike ?? this.isLike
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..deleted = deleted ?? this.deleted
      ..children = children ?? this.children
      ..commentCount = commentCount ?? this.commentCount
      ..commentLikeX = commentLikeX ?? this.commentLikeX
      ..commentLikeXOnclick = commentLikeXOnclick ?? this.commentLikeXOnclick;
  }
}
